namespace _136 {

var singleNumber = function(nums: number[]): number {
    var xs  = new Set<number>()
    for(var x of nums) {
        if ( xs.has(x)) xs.delete(x)
        else xs.add(x)
    }
    return xs.values().next().value
};

}